//
//  WPCollectionViewCell.m
//  wobingwoyi
//
//  Created by WGP on 16/7/26.
//  Copyright © 2016年 WGP. All rights reserved.
//

#import "WPCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@interface WPCollectionViewCell ()

@property (nonatomic, strong) UIImageView *iconView;

@end

@implementation WPCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.iconView = [[UIImageView alloc] init];
        [self addSubview:self.iconView];
    }
    return self;
}

- (void)setURLString:(NSString *)URLString {
    _URLString = URLString;
    [self.iconView sd_setImageWithURL:[NSURL URLWithString:URLString] placeholderImage:[UIImage imageNamed:@"loadFailed"]];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.iconView.frame = self.bounds;
}

@end
